home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Compilers⁄Interps
/
little-c
/
Ex6.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-04
|
368b
|
25 lines
/* The loop statements. */
main()
{
int a;
char ch;
/* the while */
puts("Enter a number: ");
a = getnum();
while(a) {
print(a);
print(a*a);
puts("");
a = a - 1;
}
/* the do-while */
puts("enter characters, 'q' to quit");
do {
ch = getche();
} while(ch!='q');
/* the for */
for(a=0; a<10; a = a + 1) {
print(a);
}
}